home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / lib / float.mli < prev    next >
Encoding:
Text File  |  1993-09-24  |  3.4 KB  |  79 lines  |  [TEXT/MPS ]

  1. (* Operations on floating-point numbers *)
  2.  
  3. value int_of_float : float -> int = 1 "int_of_float"
  4.         (* Truncate the given float to an integer value.
  5.            The result is unspecified if it falls outside the
  6.            range of representable integers. *)
  7.   and float_of_int : int -> float = 1 "float_of_int";;
  8.         (* Convert an integer to floating-point. *)
  9.  
  10. value minus : float -> float = 1 "~float"
  11.   and minus_float : float -> float = 1 "~float"
  12.         (* Unary negation. *)
  13.   and prefix + : float -> float -> float = 2 "+float"
  14.   and prefix +. : float -> float -> float = 2 "+float"
  15.   and add_float : float -> float -> float = 2 "+float"
  16.         (* Addition. *)
  17.   and prefix - : float -> float -> float = 2 "-float"
  18.   and prefix -. : float -> float -> float = 2 "-float"
  19.   and sub_float : float -> float -> float = 2 "-float"
  20.         (* Subtraction. *)
  21.   and prefix * : float -> float -> float = 2 "*float"
  22.   and prefix *. : float -> float -> float = 2 "*float"
  23.   and mult_float : float -> float -> float = 2 "*float"
  24.         (* Product. *)
  25.   and prefix / : float -> float -> float = 2 "/"
  26.   and prefix /. : float -> float -> float = 2 "/"
  27.   and div_float : float -> float -> float = 2 "/"
  28.         (* Division. The result is unpredictable if the dividend is 0.0. *)
  29.   and eq_float : float -> float -> bool = 2 "=float"
  30.   and prefix =. : float -> float -> bool = 2 "=float"
  31.         (* Floating-point equality.
  32.            Equivalent to generic equality, just faster. *)
  33.   and neq_float : float -> float -> bool = 2 "<>float"
  34.   and prefix <>. : float -> float -> bool = 2 "<>float"
  35.         (* Negation of [eq_float]. *)
  36.   and prefix < : float -> float -> bool = 2 "<float"
  37.   and prefix <. : float -> float -> bool = 2 "<float"
  38.   and lt_float : float -> float -> bool = 2 "<float"
  39.   and prefix > : float -> float -> bool = 2 ">float"
  40.   and prefix >. : float -> float -> bool = 2 ">float"
  41.   and gt_float : float -> float -> bool = 2 ">float"
  42.   and prefix <= : float -> float -> bool = 2 "<=float"
  43.   and prefix <=. : float -> float -> bool = 2 "<=float"
  44.   and le_float : float -> float -> bool = 2 "<=float"
  45.   and prefix >= : float -> float -> bool = 2 ">=float"
  46.   and prefix >=. : float -> float -> bool = 2 ">=float"
  47.   and ge_float : float -> float -> bool = 2 ">=float"
  48.         (* Usual comparisons between floating-point numbers. *)
  49. ;;
  50.  
  51. value exp : float -> float = 1 "exp_float"
  52.   and log : float -> float = 1 "log_float"
  53.   and sqrt : float -> float = 1 "sqrt_float"
  54.   and power : float -> float -> float = 2 "power_float"
  55.   and sin : float -> float = 1 "sin_float"
  56.   and cos : float -> float = 1 "cos_float"
  57.   and tan : float -> float = 1 "tan_float"
  58.   and asin : float -> float = 1 "asin_float"
  59.   and acos : float -> float = 1 "acos_float"
  60.   and atan : float -> float = 1 "atan_float"
  61.   and atan2 : float -> float -> float = 2 "atan2_float"
  62.           (* Usual transcendental functions on floating-point numbers. *)
  63. ;;
  64.  
  65. value abs_float : float -> float
  66.           (* Return the absolute value of the argument. *)
  67. ;;
  68.  
  69. value string_of_float : float -> string
  70.         (* Convert the given float to its decimal representation. *)
  71.   and float_of_string : string -> float = 1 "float_of_string"
  72.         (* Convert the given string to a float, in decimal.
  73.            The result is unspecified if the given string is not
  74.            a valid representation of a float. *)
  75. (*--*)
  76.   and format_float : string -> float -> string = 2 "format_float"
  77. ;;
  78.  
  79.